package com.abapi.pay.admin.service.impl;

import com.abapi.cloud.socket.pojo.TcpSession;
import com.abapi.pay.admin.service.AbstractEndpointService;
import com.abapi.pay.admin.support.db.service.PayBackInfoService;
import com.abapi.pay.core.annotation.EndpointMapping;
import com.abapi.pay.core.constans.MessageType;
import com.abapi.pay.core.dto.AbstractBody;
import com.abapi.pay.core.dto.MessageDTO;
import com.abapi.pay.core.dto.SuccessDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author ldx
 * @Date 2019/11/4 14:06
 * @Description
 * @Version 1.0.0
 */
@Service
@EndpointMapping(value = MessageType.SUCCESS,desc = "消息消息成功")
public class SuccessServiceImpl implements AbstractEndpointService {

    @Autowired
    PayBackInfoService payBackInfoService;

    @Override
    public void handler(TcpSession session, MessageDTO<AbstractBody> messageDTO) {
        SuccessDTO dto = (SuccessDTO) messageDTO.getBody();
        payBackInfoService.success(dto);
    }
}
